From 8991275fbd0e8d3cb18568eaf054cd577099ac6a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 3 Apr 2020 17:39:49 -0400 Subject: [PATCH] colorbutton: Fix focus The colorbutton contains a button which contains a colorswatch. We want the focus to go straight to the button, nowhere else, so mark the swatch as !can-focus. Adapt tests to match. --- gtk/gtkcolorbutton.c | 1 + testsuite/gtk/focus-chain/widget-factory.tab | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c index 1638cdc6ee..13dbc36c79 100644 --- a/gtk/gtkcolorbutton.c +++ b/gtk/gtkcolorbutton.c @@ -265,6 +265,7 @@ gtk_color_button_init (GtkColorButton *button) gtk_widget_set_parent (priv->button, GTK_WIDGET (button)); priv->swatch = gtk_color_swatch_new (); + gtk_widget_set_can_focus (priv->swatch, FALSE); layout = gtk_widget_create_pango_layout (GTK_WIDGET (button), "Black"); pango_layout_get_pixel_extents (layout, NULL, &rect); g_object_unref (layout); diff --git a/testsuite/gtk/focus-chain/widget-factory.tab b/testsuite/gtk/focus-chain/widget-factory.tab index 1812f0c8f6..2a95755abd 100644 --- a/testsuite/gtk/focus-chain/widget-factory.tab +++ b/testsuite/gtk/focus-chain/widget-factory.tab @@ -16,7 +16,6 @@ GtkToggleButton GtkToggleButton GtkButton GtkButton -GtkColorSwatch GtkButton GtkLinkButton GtkSwitch -- 2.30.2